<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>接口注册中心</title>
</head>
<body>
    <script>
        {% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
                {% for category, message in messages %}
                    alert("{{ message }}");
                {% endfor %}
            {% endif %}
        {% endwith %}
    </script>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f5f5f5;
            padding: 20px;
        }
        .container {
            max-width: 800px;
            margin: 0 auto;
            background: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        .form-group {
            margin-bottom: 20px;
            display: flex;
            align-items: center; /* 垂直居中对齐 */
            gap: 10px; /* 设置元素之间的间距 */
        }
        .form-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
        }
        .form-group input, .form-group textarea {
            width: 100%;
            border: 3px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
            height: 30px;
        }

        .form-group input:focus, .form-group textarea:focus {
            outline: none;
            border-color: #007BFF;
            box-shadow: 0 0 5px rgba(233, 243, 253, 0.5);
        }

        .form-group textarea {
            height: 300px;
        }

        .submit-btn {
            background-color: #007BFF;
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
            margin: 0 auto;
            display: block;
        }
        .error-message {
            color: red;
            margin-bottom: 15px;
        }
    </style>

    <div class="container">
        <a href="javascript:history.back()" style="display: block; text-align: right; margin-bottom: 20px; color: #007BFF; text-decoration: none;">返回上一级</a>

        <form action="/update_api" method="post" enctype="multipart/form-data">

            <h5 style="color: #007BFF; text-align: center; margin-bottom: 20px;">测试桩-接口编辑</h5>

            <div class="form-group">
                <label for="interfaceCode">接口编码(非中文):</label>
            </div>
            <div class="form-group">
                <input type="text" name="api_name" id="api_name"  value={{api_name}}>
            </div>
            <div class="form-group">
                <label for="interfaceCode">接口名称:</label>
            </div>
            <div class="form-group">
                <input type="text" name="description" id="description"   value={{description}}>
            </div>

            <div class="form-group">
                <label for="interfaceCode">请求地址:</label>
            </div>
            <div class="form-group">
                    <input type="text"  name="url" id="url"  value={{url_path}} placeholder="请以/ 开头">
            </div>

            <div class="form-group">
                <label>响应报文：</label>
            </div>

            <div class="form-group">
                <textarea class="textarea" name="data" >{{data}}</textarea>
            </div>

                <div>
                    <button type="submit" class="submit-btn">提交</button>

                </div>

            </div>
        </div>

    </form>
</body>
</html>